package clases;
import java.util.Collection;

public class HabilitarSoloIPS extends Accion{

		private Collection<IP>ipsAHabilitar;
		private String msjDeLog;
		
		public HabilitarSoloIPS(Collection<IP> ipsABloquear) {
			super();
			this.ipsAHabilitar = ipsABloquear;
			this.msjDeLog = "";

		}
		public HabilitarSoloIPS(Collection<IP> ipsABloquear, String msjDeLog) {
			super();
			this.ipsAHabilitar = ipsABloquear;
			this.msjDeLog = msjDeLog;
		}

		@Override
		public void aplicar(Paquete paquete) {
			if(!this.ipsAHabilitar.contains(paquete.getOrigen())){
				System.out.println("No se pueden recibir msj de la" + paquete.getOrigen() + "por encontrarse no habilitada");
				if(this.msjDeLog != ""){
					System.out.println("LOG:" + this.msjDeLog);
				}
			}
		}

		public void setIpsAHabilitar(Collection<IP> ipsABloquear) {
			this.ipsAHabilitar = ipsABloquear;
		}

		public Collection<IP> getIpsAHabilitar() {
			return ipsAHabilitar;
		}


		public String getMsjDeLog() {
			return msjDeLog;
		}


		public void setMsjDeLog(String msjDeLog) {
			this.msjDeLog = msjDeLog;
		}


	

}
